class DB_Agent:
    def __init__(self):
        pass

    def connect(self):
        import pymysql
        print('Connecting..')
        self.conn = pymysql.connect(host='127.0.0.1', port=3306, user='robot', passwd='qa1ws2ed3771772', db='drupal_test', charset='utf8')
        self.cursor = self.conn.cursor()

    def close(self):
        print ('Closing')
        self.cursor.close()
        self.conn.close()


    def get_games_id(self):
        self.cursor.execute(" select nid, field_lfch_game_value from content_type_game;")

        for r in self.cursor.fetchall():
           print (r)

    def execute(self, string, silent = False):
        self.cursor.execute(string)

        if not silent:
            for r in self.cursor.fetchall():
                print (r)

        return self.cursor.fetchall()